package com.zhz.common.tool.mybatisplus.base.dal.starter;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import com.zhz.common.tool.mybatisplus.base.dal.handler.BaseMetaObjectHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 自动装配类
 * @author zhouhengzhe
 */
@Configuration
public class DalCrudAutoConfiguration {
    private static final Logger log = LoggerFactory.getLogger(DalCrudAutoConfiguration.class);

    public DalCrudAutoConfiguration() {
    }

    @Bean
    @ConditionalOnMissingBean
    public MetaObjectHandler metaObjectHandler() {
        log.info("### base init : curd MetaObjectHandler ###");
        return new BaseMetaObjectHandler();
    }
}
